using dnAnalytics.Math;
using NUnit.Framework;

namespace dnAnalytics.Tests.Math
{
    [TestFixture]
    public class ComplexMath_AbsoluteTest32
    {
        [Test]
        public void Absolute()
        {
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, 1.19209289550780998537e-7F)), 1.19209289550780998537e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, -1.19209289550780998537e-7F)), 1.19209289550780998537e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, 5.0e-1F)), 5.0e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, -5.0e-1F)), 5.0e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, 1.0F)), 1.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, -1.0F)), 1.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, 2.0F)), 2.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, -2.0F)), 2.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, 8.388608e6F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(0.0F, -8.388608e6F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, 0.0F)), 1.19209289550780998537e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, 0.0F)), 1.19209289550780998537e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, 1.19209289550780998537e-7F)), 1.68587394043575771526e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, -1.19209289550780998537e-7F)), 1.68587394043575771526e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, 1.19209289550780998537e-7F)), 1.68587394043575771526e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, -1.19209289550780998537e-7F)), 1.68587394043575771526e-7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, 5.0e-1F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, -5.0e-1F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, 5.0e-1F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, -5.0e-1F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, 1.0F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, -1.0F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, 1.0F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, -1.0F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, 2.0F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, -2.0F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, 2.0F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, -2.0F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, 8.388608e6F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.19209289550780998537e-7F, -8.388608e6F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, 8.388608e6F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.19209289550780998537e-7F, -8.388608e6F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, 0.0F)), 5.0e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, 0.0F)), 5.0e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, 1.19209289550780998537e-7F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, -1.19209289550780998537e-7F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, 1.19209289550780998537e-7F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, -1.19209289550780998537e-7F)), 5.00000000000014210855e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, 5.0e-1F)), 7.07106781186547524401e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, -5.0e-1F)), 7.07106781186547524401e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, 5.0e-1F)), 7.07106781186547524401e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, -5.0e-1F)), 7.07106781186547524401e-1, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, 1.0F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, -1.0F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, 1.0F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, -1.0F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, 2.0F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, -2.0F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, 2.0F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, -2.0F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, 8.388608e6F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(5.0e-1F, -8.388608e6F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, 8.388608e6F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-5.0e-1F, -8.388608e6F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, 0.0F)), 1.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, 0.0F)), 1.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, 1.19209289550780998537e-7F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, -1.19209289550780998537e-7F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, 1.19209289550780998537e-7F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, -1.19209289550780998537e-7F)), 1.00000000000000710543, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, 5.0e-1F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, -5.0e-1F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, 5.0e-1F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, -5.0e-1F)), 1.1180339887498948482, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, 1.0F)), 1.4142135623730950488, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, -1.0F)), 1.4142135623730950488, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, 1.0F)), 1.4142135623730950488, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, -1.0F)), 1.4142135623730950488, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, 2.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, -2.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, 2.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, -2.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, 8.388608e6F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(1.0F, -8.388608e6F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, 8.388608e6F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-1.0F, -8.388608e6F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, 0.0F)), 2.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, 0.0F)), 2.0, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, 1.19209289550780998537e-7F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, -1.19209289550780998537e-7F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, 1.19209289550780998537e-7F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, -1.19209289550780998537e-7F)), 2.00000000000000355271, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, 5.0e-1F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, -5.0e-1F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, 5.0e-1F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, -5.0e-1F)), 2.06155281280883027491, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, 1.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, -1.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, 1.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, -1.0F)), 2.23606797749978969641, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, 2.0F)), 2.8284271247461900976, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, -2.0F)), 2.8284271247461900976, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, 2.0F)), 2.8284271247461900976, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, -2.0F)), 2.8284271247461900976, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, 8.388608e6F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(2.0F, -8.388608e6F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, 8.388608e6F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-2.0F, -8.388608e6F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, 0.0F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, 0.0F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, 1.19209289550780998537e-7F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, -1.19209289550780998537e-7F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, 1.19209289550780998537e-7F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, -1.19209289550780998537e-7F)), 8.388608e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, 5.0e-1F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, -5.0e-1F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, 5.0e-1F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, -5.0e-1F)), 8.38860800000001490116e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, 1.0F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, -1.0F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, 1.0F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, -1.0F)), 8.38860800000005960464e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, 2.0F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, -2.0F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, 2.0F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, -2.0F)), 8.38860800000023841858e6, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, 8.388608e6F)), 1.18632832030314441111e7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(8.388608e6F, -8.388608e6F)), 1.18632832030314441111e7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, 8.388608e6F)), 1.18632832030314441111e7, 6);
            TestHelper.TestSignificantDigits(ComplexMath.Absolute(new Complex32(-8.388608e6F, -8.388608e6F)), 1.18632832030314441111e7, 6);
        }
    }
}